package _13获取和设置线程名称;

public class Demo {
    public static void main(String[] args) {
        Thread t = new Thread();
        String name = t.getName();
        System.out.println(name);

        Thread t2 = new Thread();
        t2.setName("线程2");
        System.out.println(t2.getName());


        Thread t3 = new Thread("线程3");
        System.out.println(t3.getName());


        Thread t4 = new Thread(new Runnable() {
            @Override
            public void run() {
                System.out.println("t4线程的任务");
            }
        },"线程4");

        System.out.println(t4.getName());

    }
}
